﻿using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GazziWpf.Ef.EntityFrameWorkCore.User;
using Prism.Events;

namespace GazziWpf.Application.Core.ViewModels
{
    public class ViewAViewModel : ViewModelBase<User>
    {


        #region 属性
        private string _message;
        public string Message
        {
            get { return _message; }
            set { SetProperty(ref _message, value); }
        }


        #endregion


        public ViewAViewModel(IEventAggregator eventAggregator):base(eventAggregator)
        {
            Message = "View A from your Prism Module";
        }


        #region 方法
        public override void GetCurrentPageList()
        {

            base.GetCurrentPageList();
            var list = new List<User>();
            list.Add(new User(){UserName = "Gazzi",PassWord="111111",CreateTime=DateTime.Now,LoginTimes=PageNo});
            list.Add(new User(){UserName = "TangCat",PassWord="123456",CreateTime=DateTime.Now,LoginTimes=PageNo});
            list.Add(new User() { UserName = "Gudu", PassWord = "123456", CreateTime = DateTime.Now, LoginTimes = PageNo });

            this.Entity_List = new System.Collections.ObjectModel.ObservableCollection<User>(
         list
                );
        }


        public override void ExecuteSearchCommand()
        {
            base.ExecuteSearchCommand();
            this.PageSize = 1;
        }
        #endregion

    }
}
